<template>
  <div>
    <el-select
      :value="wxClientId"
      placeholder="请选择客户端"
      clearable
      size="small"
      @change="onChange"
      :style="{width: '100%'}">
      <el-option
        v-for="dict in clientList"
        :key="dict.id"
        :label="dict.name"
        :value="dict.id"
      />
    </el-select>
  </div>
</template>

<script>
import {listClient} from "@/api/wx/client"
export default {
  name: "wx-client",
  props: {
    queryParams: {
      status: 1
    },
    clientId: undefined
  },
  data(){
    return {
      clientList: [],
    }
  },
  computed:{
    wxClientId: {
      get(){
        return this.clientId
      },
      set(val){
        this.clientId = val
      }
    }
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      listClient(this.queryParams).then(response => {
        this.clientList = response.rows;
      })
    },
    onChange(e){
      this.$emit("wx-client",e);
    }
  }
}
</script>

<style scoped>

</style>
